package Buildings.threads;
import java.util.Iterator;
import Interfaces.*;
public class Repairer extends Thread{//ремонт
    private Floor processFloor;
    public void run(){
        //this.setPriority(1);
        try{
        Iterator it=processFloor.iterator();
        int i=0;
        while(it.hasNext()){
            Space sp=(Space)it.next();
            System.out.println("Ремонт помещения номер "+i+" площадью "+sp.getHowMuchArea());
            i++;
            Thread.sleep(1000);
        }
        }catch(InterruptedException e){
            System.out.println("Поток "+this+" прерван");
        }
    }
    public Repairer(Floor f){
        super("Поток ремонта");
        processFloor=f;
        start();
    }
}
